<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Avia Agency</title>
    </h:head>
    <h:body>
        <h:form>     
            Please, fill the following fields to register
            <h:panelGrid columns="2">
                <h:outputLabel value="Login:"/>
                <h:inputText id="login" value="#{register.login}"/>
                <h:outputLabel  value="Password:"/>
                <h:inputSecret id="password" value="#{register.password}"/>.
                <h:outputLabel value="First name:"/>
                <h:inputText id="first_name" value="#{register.first_name}"/>
                <h:outputLabel value="Last name:"/>               
                <h:inputText id="last_name" value="#{register.last_name}"/>
                                <div align="center"><h:commandButton value="vALID1"/></div>
                
                <div align="center"><h:commandButton value="Register" actionListener="#{register.register()}" action="index.xhtml"/></div>
            </h:panelGrid>
        </h:form>    
        
        
        <h:form>
            <h:panelGrid columns="">
            Hello, what is your name?
            <h:inputText value="#{register.login}"/>
            
            Last Name?            
            <h:inputText id="id1" label="Last Name" value="#{register.password}"
                         required="true">
               
                <f:validateLength minimum="4"/>
                <f:ajax event="keydown"
                        execute="id1"
                        render="id2"/>
            </h:inputText>
            <h:message id="id2" for="id3" errorStyle="color: red"/>
            
            <h:commandButton value="Ok" id="id3">
                <f:ajax render="a1"/>
            </h:commandButton>
            <h:outputLabel id="a1" for="a1" value="qwweerty"    />

            <h:outputText value="Hello, #{register.login} #{register.password}"/>
            </h:panelGrid>
        </h:form>
    </h:body>
</html>

